import request from '@/utils/request'

// 查询存储配置列表
export function listStorageConfig(query) {
  return request({
    url: '/file/storage/config/list',
    method: 'get',
    params: query
  })
}

// 查询存储配置详细
export function getStorageConfig(configId) {
  return request({
    url: '/file/storage/config/' + configId,
    method: 'get'
  })
}

// 新增存储配置
export function addStorageConfig(data) {
  return request({
    url: '/file/storage/config',
    method: 'post',
    data: data
  })
}

// 修改存储配置
export function updateStorageConfig(data) {
  return request({
    url: '/file/storage/config',
    method: 'put',
    data: data
  })
}

// 删除存储配置
export function delStorageConfig(configIds) {
  return request({
    url: '/file/storage/config/' + configIds,
    method: 'delete'
  })
}

// 设置默认存储配置
export function setDefaultStorageConfig(configId) {
  return request({
    url: '/file/storage/config/setDefault/' + configId,
    method: 'put'
  })
}

// 测试存储配置连接
export function testStorageConfig(data) {
  return request({
    url: '/file/storage/config/test',
    method: 'post',
    data: data
  })
}

// 修改存储配置状态
export function changeStorageConfigStatus(data) {
  return request({
    url: '/file/storage/config/changeStatus',
    method: 'put',
    data: data
  })
}